function F = fieldnames(S)
% BVQXinifile::fieldnames  - get fieldnames

% Version:      v0.7b
% Build:        7090311
% Date:         Sep-03 2007, 11:35 AM CEST
% Author:       Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL / Info:   http://wiki.brainvoyager.com/BVQXtools

% not allowed for larger arrays
if numel(S) ~= 1
    error( ...
        'BVQXfile:BadArgument', ...
        'Fieldnames can only be obtain for 1x1 objects.' ...
    );
end

% sort methods with section names
sects = BVQXinifile(S, 'getsections');
F = sort([sects(:); methods(S)]);
